package com.shd.day02;

/**
 * 表达式
 * 
 * @author S5343
 * @date 2018年7月20日下午10:57:56
 */
public class LambdaExpression {

	public static void main(String[] args) {
		// Java8之前的写法
		Runnable r1 = new Runnable() {

			@Override
			public void run() {
				System.out.println("Hello");
			}
		};

		// Java8Lambda
		Runnable r2 = () -> System.out.println("Hello");

		process(r1);
		process(r2);
		process(() -> System.out.println("Hello"));
	}

	private static void process(Runnable r) {
		r.run();
	}
}
